<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>设备配置管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		//打开墨盒配置
		function openInkConfig(deviceSn,deviceName){
			top.$.jBox.open("iframe:${ctx}/jiujiudevice/jiuInk?deviceSn="+deviceSn,
					deviceName,$(top.document).width()-600,$(top.document).height()-170,{
				buttons:{"关闭":true}, loaded:function(h){
					$(".jbox-content", top.document).css("overflow-y","hidden");
				}
			});
		}
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/jiujiudevice/jiuDevice/">设备配置列表</a></li>
		<shiro:hasPermission name="jiujiudevice:jiuDevice:edit"><li><a href="${ctx}/jiujiudevice/jiuDevice/form">设备配置添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="jiuDevice" action="${ctx}/jiujiudevice/jiuDevice/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>名称 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;
		<label>SN：</label><form:input path="sn" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;
		<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
		<th>设备名称</th>
		<th>公司名称</th>
		<th>单价</th>
		<th>SN</th>
		<th>创建时间</th>
		<shiro:hasPermission name="jiujiudevice:jiuDevice:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="jiuDevice">
			<tr>
				<td><a href="${ctx}/jiujiudevice/jiuDevice/form?id=${jiuDevice.id}">${jiuDevice.name}</a></td>
				<td>${jiuDevice.companyName}</td>
							    <td>${jiuDevice.price }<span style="color:grey;">&nbsp;元/分钟</span></td>
							    <td>${jiuDevice.sn }</td>
							    <td><fmt:formatDate value="${jiuDevice.createTime}" type="both"/>    </td>
				
				<shiro:hasPermission name="jiujiudevice:jiuDevice:edit"><td>
    				<a class="btn btn-success" href="${ctx}/jiujiudevice/jiuDevice/form?id=${jiuDevice.id}">修改</a>
					<a class="btn btn-danger" href="${ctx}/jiujiudevice/jiuDevice/delete?id=${jiuDevice.id}" onclick="return confirmx('确认要删除该设备配置吗？', this.href)">删除</a>
				    <a class="btn btn-primary" href="javascript:openInkConfig('${jiuDevice.sn}','${jiuDevice.name }')">墨盒配置</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
